package com.minelx.datamicroscope.launch;

import com.alibaba.fastjson.JSON;
import com.minelx.datamicroscope.core.query.Query;
import io.gitee.minelx.filesystem.provider.FS;
import io.gitee.minelx.filesystem.File;

import java.io.IOException;
import java.nio.charset.StandardCharsets;

import static io.gitee.minelx.filesystem.init.OpenPolicy.*;

public class OpenFileMainTest {
	public static void main(String[] args) throws IOException {
		File querySourceFile = FS.local().file(args[0].replace("\\", "/"), EXISTS);
		String queryContent = querySourceFile.read(StandardCharsets.UTF_8);
		File destination = FS.workingDir().child().file(args[1], CREATE);
		Query.localFSAndOnlineIndexWithPandasCalculationSupport(JSON.parseObject(queryContent))
				.queryTo(destination.path().uri());
	}
}
